<%@ page isELIgnored="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<html>
<head>
	<title>DBsync4J</title>
	<link rel="stylesheet" type="text/css" href="css/estilo.css" />
</head>

<body>
<br><br><br><br><br><br>
<table class="teste" align="center" width="65%">
	<tr>
		<td width="50%"> 
			<form name="datasource" method="post" action="datasource">
			<input name="statusOrigem" type="hidden" value="<c:if test="${sOrigem == null}">disconnected</c:if><c:if test="${sOrigem != null}">connected</c:if>"></input>
    		
    		<table  class="" width="100%" align="center">
     			<thead>
     				<tr>
      					<th scope="col" width="35%">
      						<font color="red">* </font>Server name:
        				</th>
        				<th scope="col" width="65%">
        					<input type="text" name="servidor" value="<c:out value="${serverOrigem.name}"/>">
        				</th>
    				</tr>
    				<tr>
	       				<th scope="col">
	       					<font color="red">* </font>Database:
	       				</th>
	       				<th>
				         	<select name="banco" class="comboBox">
					            <option value="0"<c:if test="${sDatabaseType == 0}">selected="selected" </c:if>>Postgresql</option>
					            <option value="1"<c:if test="${sDatabaseType == 1}">selected="selected" </c:if>>MySQL</option>
					            <option value="2"<c:if test="${sDatabaseType == 2}">selected="selected" </c:if>>SQL Server</option>
					            <option value="4" disabled="disabled">Oracle</option>
				          	</select>
				        </th>
    				</tr>
    				<tr>
      					<th scope="col">
      						<font color="red">* </font>User:
      					</th>
      					<th>
      						<input type="text" name="usuario" value="<c:out value="${serverOrigem.username}"/>">
      					</th>
    				</tr>
    				<tr>
      					<th scope="col">
      						<font color="red">* </font>Password:
      					</th>
      					<th>
					        <input type="password" name="senha" maxlength= "12" value="<c:out value="${serverOrigem.password}"/>">
					    </th>
    				</tr>
   					<tr>
      					<th scope="col">
      						<font color="red">* </font>URL:
      					</th>
      					<th>
      						<input type="text" name="url" value="<c:out value="${serverOrigem.url}"/>">
      					</th>
					</tr>
    				<tr>
						<th scope="col" colspan="2">Status: 
							<c:if test="${serverOrigem == null}"><font color="red">Disconneted</font></c:if>
							<c:if test="${serverOrigem != null}"><font color="green">I'm ready</font></c:if></th>
					</tr>
				</thead>
    			<tfoot>
					<tr>
	      				<th colspan="2">
	      					<button type="submit" value="Conectar" <c:if test="${serverOrigem != null}">disabled="disabled"</c:if>>
	      						<img src="img/conectar.png" alt=""/>
	      						<font color="#000000">Connect</font>
	      					</button>
	      					<button type="submit" value="Desconectar" <c:if test="${serverOrigem == null}">disabled="disabled"</c:if>>
	      						<img src="img/database.png" alt=""/>
	      						<font color="#000000">Disconnect</font>
	      					</button>
	      				</th>
				    </tr>
    			</tfoot>
    		</table>
    		</form>
    	</td>
    	
    	<td width="100%">
    		<form name="datasource" method="post" action="datasource">
   			<input name="statusDestino" type="hidden" value="<c:if test="${serverDestino == null}">disconnected</c:if><c:if test="${serverDestino != null}">connected</c:if>">
	
			<table width="100%" align="center">
    			<thead>
					<tr>
				     	<th scope="col" width="35%">
				     		<font color="red">* </font>Server:
				     	</th>
				     	<th width="65%">
				      		<input type="text" name="servidor" value="<c:out value="${serverDestino.name}"/>">
				      	</th>
				    </tr>
				 	<tr>
      					<th scope="col">
      						<font color="red">* </font>Database:
      					</th>
      					<th>
	           				<select name="banco" class="comboBox">
					            <option value="0"<c:if test="${sDatabaseType == 0}">selected="selected" </c:if>>Postgresql</option>
					            <option value="1"<c:if test="${sDatabaseType == 1}">selected="selected" </c:if>>MySQL</option>
					            <option value="2"<c:if test="${sDatabaseType == 2}">selected="selected" </c:if>>SQL Server</option>
					            <option value="4" disabled="disabled">Oracle</option>
	          				</select>
          				</th>
    				</tr>
     				<tr>
      					<th scope="col">
      						<font color="red">* </font>User:
      					</th>
      					<th>
      						<input type="text" name="usuario" value="<c:out value="${serverDestino.username}"/>">
      					</th>
    				</tr>
    				<tr>
      					<th scope="col">
      						<font color="red">* </font>Password:
      					</th>
      					<th>
      						<input name="senha" type="password" maxlength="12" value="<c:out value="${serverDestino.password}"/>">
      					</th>
    				</tr>
    				<tr>
      					<th scope="col">
      						<font color="red">* </font>URL:
      					</th>
      					<th>
      						<input type="text" name="url" value="<c:out value="${serverDestino.url}"/>"></th>
      					</th>
    				</tr>
     				<tr>
						<th scope="col" colspan="2">Status: 
							<c:if test="${serverDestino == null}"><font color="red">Disconnected</font></c:if>
							<c:if test="${serverDestino != null}"><font color="green">I'm ready</font></c:if>
						</th>
					</tr>
				</thead>
     			<tfoot>
					<tr>
      					<th colspan="2">
      						<button type="submit" value="Conectar" <c:if test="${serverDestino != null}">disabled="disabled"</c:if>>
      							<img src="img/conectar.png" alt=""/>
      							<font color="#000000">Connect</font>
      						</button>
      						<button type="submit" value="Desconectar" <c:if test="${serverDestino == null}">disabled="disabled"</c:if>>
      							<img src="img/database.png" alt=""/>
      							<font color="#000000"> Disconnect</font>
      						</button>
      					</th>
    				</tr>
    			</tfoot>
    		</table>
    		</form>
  		</td>
  	</tr>
 </table>
   
<center><font color="red" style="font: verdana;">${mensagemErroOrigem}${mensagemErroDestino}</font></center>

<table class="teste" width="65%" align="center" border="0">
	<tr>
		<td>
			<form action="comparedatabases" method="post">
				<button  style="float: right;" type="submit" value="Comparar">
					<img src="img/fig.png" alt=""/>Compare it!
				</button>
			</form>
		</td>
	</tr>
</table>
   	
</body>
</html>
